package com.xyz.timekeeper.database

import androidx.room.*

@Dao
interface TimeRecordDao {
    @Query("SELECT * FROM time_records WHERE date(startTime) = :date ORDER BY id ASC")
    suspend fun getRecordsByDate(date: String): List<TimeRecord>

    @Query("SELECT * FROM time_records ORDER BY id ASC")
    suspend fun getAllRecords(): List<TimeRecord>

    @Insert
    suspend fun insert(record: TimeRecord)

    @Update
    suspend fun update(record: TimeRecord)

    @Delete
    suspend fun delete(record: TimeRecord)
}